﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleNotify.ClientLibrary.Translators
{
    public static class NotificationTypeTranslator
    {
        public static NotifyService.NotificationType EntityToDataContract(NotificationType fromType)
        {
            NotifyService.NotificationType toType = NotifyService.NotificationType.None;
            switch (fromType)
            {
                case NotificationType.Information:
                    toType = NotifyService.NotificationType.Information;
                    break;
                case NotificationType.Warning:
                    toType = NotifyService.NotificationType.Warning;
                    break;
                case NotificationType.Error:
                    toType = NotifyService.NotificationType.Error;
                    break;
                case NotificationType.Confirmation:
                    toType = NotifyService.NotificationType.Confirmation;
                    break;
            }
            return toType;
        }

        public static NotificationType DataContractToEntity(NotifyService.NotificationType fromType)
        {
            NotificationType toType = NotificationType.None;
            switch (fromType)
            {
                case NotifyService.NotificationType.Information:
                    toType = NotificationType.Information;
                    break;
                case NotifyService.NotificationType.Warning:
                    toType = NotificationType.Warning;
                    break;
                case NotifyService.NotificationType.Error:
                    toType = NotificationType.Error;
                    break;
                case NotifyService.NotificationType.Confirmation:
                    toType = NotificationType.Confirmation;
                    break;
            }
            return toType;
        }
    }
}
